﻿<%@ Page Title="Външни категории" Language="C#" MasterPageFile="~/MasterPage.master"
    AutoEventWireup="true" CodeFile="ExternalCategories.aspx.cs" Inherits="ExternalCategories" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CenterContentPlaceHolder" runat="Server">
    <asp:ListView ItemPlaceholderID="itemPlaceHolder" ID="FeedItemCategoriesListView"
        runat="server" DataSourceID="FeedItemCategoriesDataSource">
        <ItemTemplate>
            <li>
                <asp:Label ID="CategoryName" runat="server" EnableViewState="false"></asp:Label>
                <a href='BrowseExternalCategory.aspx?id=<%# Eval("Key.ID") %>' />
                <%# Eval("Key.CategoryName")%>
            </a>
        </ItemTemplate>
        <EmptyDataTemplate>
            Няма категории
        </EmptyDataTemplate>
        <LayoutTemplate>
            <ul id="lastnews">
                <li id="itemPlaceHolder" runat="server"></li>
            </ul>
            <asp:DataPager ID="FeedItemsDataPager" QueryStringField="page" PageSize="45" PagedControlID="FeedItemCategoriesListView"
                runat="server">
                <Fields>
                    <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" ShowPreviousPageButton="True"
                        ShowNextPageButton="false" />
                    <asp:NumericPagerField ButtonCount="10" ButtonType="Link" NextPageText="Next" />
                    <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" ShowNextPageButton="False"
                        ShowPreviousPageButton="false" />
                </Fields>
            </asp:DataPager>
        </LayoutTemplate>
    </asp:ListView>
    <asp:LinqDataSource ID="FeedItemCategoriesDataSource" runat="server" ContextTypeName="FeedAgregator.FeedSignalDataContext"
        Select="new (Key,Count() as NumberOfItems)" TableName="FeedItemCategoryRelations"
        GroupBy="FeedItemCategory" OrderGroupsBy="Count() descending">
    </asp:LinqDataSource>
</asp:Content>
